<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>QSculpt: engine/include/Face.h Source File</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />

<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>

</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">QSculpt
   &#160;<span id="projectnumber">0.0.1a</span>
   </div>
   
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.5.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
    </ul>
  </div>
<div class="header">
  <div class="headertitle">
<div class="title">engine/include/Face.h</div>  </div>
</div>
<div class="contents">
<div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span>
<a name="l00002"></a>00002 <span class="comment"> *  untitled.h</span>
<a name="l00003"></a>00003 <span class="comment"> *  QSculpt</span>
<a name="l00004"></a>00004 <span class="comment"> *</span>
<a name="l00005"></a>00005 <span class="comment"> *  Created by Roberto Cabral on 12/4/09.</span>
<a name="l00006"></a>00006 <span class="comment"> *  Copyright 2009 __MyCompanyName__. All rights reserved.</span>
<a name="l00007"></a>00007 <span class="comment"> *</span>
<a name="l00008"></a>00008 <span class="comment"> */</span>
<a name="l00009"></a>00009 
<a name="l00010"></a>00010 <span class="preprocessor">#ifndef FACE_H_</span>
<a name="l00011"></a>00011 <span class="preprocessor"></span><span class="preprocessor">#define FACE_H_</span>
<a name="l00012"></a>00012 <span class="preprocessor"></span>
<a name="l00013"></a>00013 <span class="preprocessor">#include &lt;QAtomicInt&gt;</span>
<a name="l00014"></a>00014 <span class="preprocessor">#include &quot;Vertex.h&quot;</span>
<a name="l00015"></a>00015 <span class="preprocessor">#include &quot;IIterator.h&quot;</span>
<a name="l00016"></a>00016 
<a name="l00017"></a>00017 <span class="keyword">class </span><a class="code" href="class_edge.html">Edge</a>;
<a name="l00018"></a>00018 <span class="keyword">class </span><a class="code" href="class_i_surface.html">ISurface</a>;
<a name="l00019"></a>00019 
<a name="l00020"></a>00020 <span class="keyword">enum</span> FaceFlags {
<a name="l00021"></a>00021     FF_None     = 0,
<a name="l00022"></a>00022     FF_Selected = 0x00000001,   <span class="comment">/*&lt; Face is selected */</span>
<a name="l00023"></a>00023     FF_Deleted  = 0x00000002,  <span class="comment">/*&lt; Face is marked as deleted */</span>
<a name="l00024"></a>00024     FF_User1    = 0x00100000,  <span class="comment">/*&lt; Flag to be used by the user */</span>
<a name="l00025"></a>00025     FF_User2    = 0x00200000,  <span class="comment">/*&lt; Flag to be used by the user */</span>
<a name="l00026"></a>00026     FF_All      = 0xFFFFFFFF
<a name="l00027"></a>00027 };
<a name="l00028"></a>00028 
<a name="l00041"></a><a class="code" href="class_face.html">00041</a> <span class="keyword">class </span><a class="code" href="class_face.html">Face</a> {
<a name="l00042"></a>00042     <a class="code" href="class_i_surface.html">ISurface</a> *_surface; <span class="comment">// 4</span>
<a name="l00043"></a>00043     <a class="code" href="class_edge.html">Edge</a> *_he; <span class="comment">// 4</span>
<a name="l00044"></a>00044     <a class="code" href="class_vertex.html">Vertex</a>* _vertex; <span class="comment">// 4</span>
<a name="l00045"></a>00045     <a class="code" href="class_face.html">Face</a>* _children; <span class="comment">// 4</span>
<a name="l00046"></a>00046 
<a name="l00047"></a>00047     <span class="keywordtype">int</span> _id; <span class="comment">// 4</span>
<a name="l00048"></a>00048     <span class="keywordtype">int</span> _depth; <span class="comment">// 4</span>
<a name="l00049"></a>00049     FaceFlags _flags; <span class="comment">// 4</span>
<a name="l00050"></a>00050     <span class="keywordtype">size_t</span> _nVertices;
<a name="l00051"></a>00051     
<a name="l00052"></a>00052     <span class="keywordtype">void</span> * _userData;
<a name="l00053"></a>00053     
<a name="l00054"></a>00054 <span class="keyword">public</span>:
<a name="l00055"></a>00055     <span class="comment">//qint32 hashValue; // 4</span>
<a name="l00056"></a>00056 
<a name="l00057"></a>00057 <span class="keyword">public</span>:
<a name="l00061"></a>00061     <a class="code" href="class_face.html#ae953b1d1328cb9ef51611cde1a91ae66">Face</a>(<a class="code" href="class_i_surface.html">ISurface</a> *surface = NULL);
<a name="l00062"></a>00062 
<a name="l00071"></a>00071     <a class="code" href="class_face.html#ae953b1d1328cb9ef51611cde1a91ae66">Face</a>(<a class="code" href="class_i_surface.html">ISurface</a> *surface, <span class="keyword">const</span> QVector&lt;int&gt;&amp; vertexIndexList);
<a name="l00072"></a>00072 
<a name="l00073"></a>00073     ~<a class="code" href="class_face.html">Face</a>();
<a name="l00074"></a>00074 
<a name="l00078"></a>00078     <span class="keyword">inline</span> uint <a class="code" href="class_face.html#a60103ee2af03f9b9b6d51e657de9068a">hashCode</a>() <span class="keyword">const</span>;
<a name="l00079"></a>00079 
<a name="l00083"></a><a class="code" href="class_face.html#a67b884ee80f13f763ed9e1b47bcdf731">00083</a>     <span class="keywordtype">int</span> <a class="code" href="class_face.html#a67b884ee80f13f763ed9e1b47bcdf731">iid</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> _id; }
<a name="l00084"></a>00084 
<a name="l00094"></a><a class="code" href="class_face.html#ac585af7e79a5bb2ec49293deb21f9fb4">00094</a>     <span class="keywordtype">void</span> <a class="code" href="class_face.html#ac585af7e79a5bb2ec49293deb21f9fb4">addFlag</a>(FaceFlags flag) { _flags = (FaceFlags)(_flags | flag); }
<a name="l00095"></a>00095     <span class="keywordtype">void</span> removeFlag(FaceFlags flag) { _flags = (FaceFlags)(_flags &amp; ~flag); }
<a name="l00096"></a>00096     FaceFlags flags()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> _flags; }
<a name="l00097"></a>00097     <span class="keywordtype">void</span> setFlags(FaceFlags flags) {_flags = flags; }
<a name="l00098"></a>00098     <span class="keywordtype">bool</span> isFlagSet(FaceFlags flag) { <span class="keywordflow">return</span> (_flags &amp; flag) != 0;}
<a name="l00099"></a>00099 
<a name="l00106"></a>00106     <span class="keywordtype">bool</span> <a class="code" href="class_face.html#a56aae065db3f19eb50a8dac472ed80fc">isValid</a>();
<a name="l00107"></a>00107 
<a name="l00112"></a>00112     <a class="code" href="class_face.html">Face</a>&amp; <a class="code" href="class_face.html#a81540807c50e18e57f38da9dc360e18b">addEdge</a>(<a class="code" href="class_edge.html">Edge</a>* he);
<a name="l00113"></a>00113 
<a name="l00117"></a>00117     <span class="keywordtype">void</span> <a class="code" href="class_face.html#a9fabc7e05420b332485c11d69193f05d">addVertex</a>(<span class="keyword">const</span> QVector&lt;Vertex*&gt; v);
<a name="l00118"></a>00118 
<a name="l00122"></a><a class="code" href="class_face.html#a2ad011620fc0f9c39be8f25b54b62836">00122</a>     <a class="code" href="class_edge.html">Edge</a>* <a class="code" href="class_face.html#a2ad011620fc0f9c39be8f25b54b62836">hedge</a>() { <span class="keywordflow">return</span> _he; }
<a name="l00123"></a>00123     <span class="keywordtype">void</span> setHEdge(<a class="code" href="class_edge.html">Edge</a>* <a class="code" href="class_face.html#a2ad011620fc0f9c39be8f25b54b62836">hedge</a>);
<a name="l00124"></a>00124 
<a name="l00128"></a>00128     <span class="keywordtype">size_t</span> <a class="code" href="class_face.html#a1d4cd89c25bb8b3d759c2652ebbc9f55">numVertices</a>() <span class="keyword">const</span>;
<a name="l00129"></a>00129     
<a name="l00137"></a>00137     <span class="keywordtype">void</span> <a class="code" href="class_face.html#acf5e2b630da53686fa7d1999483526ae">setPoints</a>(<span class="keyword">const</span> QVector&lt;int&gt;&amp; vertexIndexList);
<a name="l00138"></a>00138 
<a name="l00139"></a>00139     <span class="keywordtype">bool</span> hasEdge(<span class="keyword">const</span> <a class="code" href="class_edge.html">Edge</a>&amp; <span class="comment">/*e*/</span>) <span class="keyword">const</span>;
<a name="l00140"></a>00140 
<a name="l00141"></a>00141     <span class="keywordtype">bool</span> hasEdge(<span class="keywordtype">int</span> <span class="comment">/*v1*/</span>, <span class="keywordtype">int</span> <span class="comment">/*v2*/</span>) <span class="keyword">const</span> ;
<a name="l00142"></a>00142 
<a name="l00146"></a><a class="code" href="class_face.html#a1614161ace9953a34b475ed40ea66e24">00146</a>     <span class="keywordtype">void</span> <a class="code" href="class_face.html#a1614161ace9953a34b475ed40ea66e24">setUserData</a>(<span class="keywordtype">void</span> * data) {
<a name="l00147"></a>00147         _userData = data;
<a name="l00148"></a>00148     }
<a name="l00149"></a>00149     
<a name="l00155"></a><a class="code" href="class_face.html#a5151825a1194ed0b72b96b8472f487b1">00155</a>     <span class="keywordtype">void</span> * <a class="code" href="class_face.html#a5151825a1194ed0b72b96b8472f487b1">userData</a>()<span class="keyword"> const </span>{
<a name="l00156"></a>00156         <span class="keywordflow">return</span> _userData;
<a name="l00157"></a>00157     }
<a name="l00158"></a>00158     
<a name="l00159"></a>00159     <span class="keywordtype">bool</span> operator==(<span class="keyword">const</span> <a class="code" href="class_face.html">Face</a>&amp; t) <span class="keyword">const</span>;
<a name="l00160"></a>00160 
<a name="l00161"></a>00161     operator Point3() <span class="keyword">const</span> ;
<a name="l00162"></a>00162     operator Point3();
<a name="l00163"></a>00163 
<a name="l00168"></a>00168     <a class="code" href="class_iterator.html">Iterator&lt;Vertex&gt;</a> <a class="code" href="class_face.html#a966a6e71a72fcb142103c5dad84a0463">vertexIterator</a>();
<a name="l00169"></a>00169 
<a name="l00174"></a>00174     <a class="code" href="class_iterator.html">Iterator&lt;Vertex&gt;</a> <a class="code" href="class_face.html#a6bc624e1062a2197f7d8deafc59aa2e4">constVertexIterator</a>() <span class="keyword">const</span>;
<a name="l00175"></a>00175 
<a name="l00180"></a>00180     <a class="code" href="class_iterator.html">Iterator&lt;Edge&gt;</a> <a class="code" href="class_face.html#a0162737d4ff2ced6ffe7410d89bd5c75">edgeIterator</a>();
<a name="l00181"></a>00181 
<a name="l00186"></a>00186     <a class="code" href="class_iterator.html">Iterator&lt;Edge&gt;</a> <a class="code" href="class_face.html#a047b32d62825b5e1b4b4a54c26606712">constEdgeIterator</a>() <span class="keyword">const</span>;
<a name="l00187"></a>00187 
<a name="l00188"></a>00188 <span class="keyword">protected</span>:
<a name="l00189"></a>00189     <span class="keywordtype">void</span> subdivide(<span class="keywordtype">int</span> level);
<a name="l00190"></a>00190 
<a name="l00191"></a>00191     <span class="comment">/* Inner classes */</span>
<a name="l00192"></a>00192     <span class="keyword">class </span>VertexIterator;
<a name="l00193"></a>00193     <span class="keyword">class </span>EdgeIterator;
<a name="l00194"></a>00194 
<a name="l00195"></a>00195     <span class="keyword">friend</span> <span class="keyword">class </span>VertexIterator;
<a name="l00196"></a>00196     <span class="keyword">friend</span> <span class="keyword">class </span>EdgeIterator;
<a name="l00197"></a>00197 };
<a name="l00198"></a>00198 
<a name="l00199"></a>00199 <span class="preprocessor">#endif</span>
</pre></div></div>
</div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerator</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>



<hr class="footer"/><address class="footer"><small>
Generated on Sat Aug 27 2011 15:38:52 for QSculpt by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.7.5.1
</small></address>

</body>
</html>
